<template>
  <div id="app">
    <div class="main">
   
     <!-- 路由视图 -->
     <router-view @get-player-id="getPlayerId" @get-play-all-id="getPlayAllId" ></router-view>
    
     <!-- 播放器组件 -->
    <player v-show="playerId" :player-id="playerId" :list-id="listId"  @set-player-id="setPlayerId" ></player>

    </div>
  </div>
</template>

<script>
import player from "./components/base/player.vue"
export default {
  data(){
    return {
      playerId:null,
      listId:null,
    }
  },
     components:{
    player
  },
    methods:{
      //获取子组件播放歌曲id
      getPlayerId(id){
        this.playerId = id;
      },
      getPlayAllId(id){
        this.listId = id;
        console.log(this.listId)
      },
       setPlayerId(id){
      this.playerId = id;
      },
    }
   
 
}
</script>

<style lang="less">
@import "./assets/css/base.css";
</style>